package com.zerowidth.moc.web.utils;

public class RandomUtils {

    /**
     * 生成指定长度的随机码，每位字符的值在[0,9]
     *
     * @param length
     * @return
     */
    public static String generateValidCode(int length) {
        String code = "";
        for (int i = 0; i < length; i++) {
            code += (int) (Math.random() * 10);
        }
        return code;
    }

}
